package main

import (
	"amazegame/config"
	"amazegame/core"
	"amazegame/log"
	"encoding/json"
	"flag"
	"fmt"
)

type ThisConfig struct {
	ClusterConf core.ClusterConf
	LogConf     log.Conf
}

func main() {
	var cfgFile = flag.String("c", "", "cluster config file.")
	flag.Parse()
	var conf ThisConfig
	var err error
	var outStr []byte
	if *cfgFile != "" {
		err = config.Load(*cfgFile, &conf)
		if err != nil {
			fmt.Println("can not load config file")
			return
		}
	}
	outStr, err = json.Marshal(conf)
	fmt.Println("conf:", string(outStr))
}
